package com.windowes.weichang.controller.common;

import com.windowes.weichang.common.ServerResponse;
import com.windowes.weichang.service.BDMapService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/***
 *
 * @author: yangqing
 * @email: qing.yang@bangdao-tech.com
 * @createTime: 2018/6/17 下午8:15
 * @description:
 *
 **/
@RestController
@RequestMapping("bd")
public class BDMapController {

    @Autowired
    BDMapService bdMapService;


    @PostMapping("createTable")
    public ServerResponse createTable(String tableName, @RequestParam(name = "isPublished", defaultValue = "1") int isPublished) {
        return bdMapService.createTable(tableName, isPublished);
    }

    @PostMapping("list")
    public ServerResponse list(String tableName) {
        return bdMapService.list(tableName);
    }
}
